#define  _CRT_SECURE_NO_WARNINGS 1

#include"AVLTree.h"
#include<vector>
#include<time.h>


void AVLTreeTest1()
{
	const int N = 10000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand());
	}

	AVLTree<int, int> avlt;
	for (auto e : v)
	{
		avlt.Insert(make_pair(e, e));
		cout << "Insert:" << e << "->" << avlt.IsAVLTree() << endl;
	}
	cout << avlt.IsAVLTree() << endl;
	cout << avlt.Height() << endl;
}

void AVLTreeTest2()
{
	int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	//int a[] = { 4, 2, 6, 1, 3, 5, 15, 7, 16, 14 };
	AVLTree<int, int> t;
	for (auto e : a)
	{
		t.Insert(make_pair(e, e));
		cout << "Insert:" << e << "->" << t.IsAVLTree() << endl;
	}
}

int main()
{
	AVLTreeTest1();
	return 0;
}